<div class="paymain">
<div class="pay {{$change_addr&&'focus'}}">
	<div class="main">
		<div class="title">
			<div class="tile"></div>
			确认订单信息
		</div>
	</div>
	
	<div class="item">
		<div class="title">
			订单金额：
			<span class="price">
				￥<span>{{#Fixed user.pay_ach.cash}}</span>
			</span>
		</div>
	</div>
	
	<div class="item">
		<div class="title">
			{{#if user.pay_ach.info.state!=$Top.config.ACH_STATE.未确认}}
				{{user.pay_ach.info.use_space?'店内就餐':'网购送货'}}
			{{#else}}
			店内就餐？：
			<span>
				<input type="checkbox" event-change="{{'$Event.pays.change_use_space'}}" checked="{{user.pay_ach.info.use_space}}" />
				<span>{{user.pay_ach.info.use_space&&'是'||'否'}}</span>
			</span>
			{{/if}}
		</div>
	</div>
	{{#if user.pay_ach.info.use_space}}
	<div class="item">
		{{#if user.pay_ach.info.state!=$Top.config.ACH_STATE.未确认}}
		<div class="title">
			桌号：{{user.pay_ach.info.space.name}}
		</div>
		{{#else}}
		<div class="title">
			选择桌号
		</div>
		<div class="info">
			桌号：
			<select name="tablenum"  value="{{user.pay_ach.info.space._id}}" bind-input="{{'user.pay_ach.info.space_id'}}" event-change="{{'$Event.pays.change_space'}}">
				{{#each $Cache.pay.space_seat.list}}
				{{#if use_state==$Top.config.SPACE_USE_STATE.可用}}
				<option id="{{_id}}" value="{{_id}}">{{name}}</option>
				{{/if}}
				{{/each}}
			</select>
			<!--<button>确定</button>-->
		</div>
		{{/if}}
	</div>
	{{#else}}
	<div class="item">
		<div class="title">送餐地址</div>
		{{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
		<button event-click="{{'$Event.change'}}" class="queding">更改地址</button>
		{{/if}}
		<div class="useraddr">
			{{user.pay_ach.info.user_address.name}}，
			{{user.pay_ach.info.user_address.mobilenumber}}，
			{{user.pay_ach.info.user_address.province}}
			{{user.pay_ach.info.user_address.town}}
			{{user.pay_ach.info.user_address.county}}，
			{{user.pay_ach.info.user_address.detail}}
		</div>
	</div>
	{{/if}}
	
	<div class="item">
		<div class="title">
			支付方式
		</div>
		<div class="info">
			{{#if user.pay_ach.info.state==config.ACH_STATE.未确认}}
                <mbPayMethod
                    value="alipay.wap.auth.authAndExecute"
                    text="使用支付宝网页支付"
                    disabled="{{!(bus_info.info.alipay.seller_email&&bus_info.info.alipay.key&&bus_info.info.alipay.partner)}}"
                ></mbPayMethod>
                <mbPayMethod
                    value="face_pay"
                    checked="checked"
                    text="现金付款"
                ></mbPayMethod>
	            {{#if $Top._is_weixin}}
                <mbPayMethod
                    value="weixin_pay"
                    text="微信支付"
                ></mbPayMethod>
	            {{/if}}
            {{#else}}
	            <br/>
	            <p>
	                {{#if user.pay_ach.info.pay_method=="alipay.wap.auth.authAndExecute"}}
	                使用支付宝的快捷支付(不可更改)
	                {{/if}}
	                {{#if user.pay_ach.info.pay_method=="face_pay"}}
	                现金付款(不可更改)
	                {{/if}}
	                {{#if user.pay_ach.info.pay_method=="weixin_pay"}}
	                微信支付(不可更改)
	                {{/if}}
	            </p>
            {{/if}}
		</div>
		
	</div>

	
</div>

<div class="pay">
	<br/>
	<div>
		<button class="back" event-click="{{'$Event.change'}}">返回</button>
	</div>
	{{#each user.address_detail}}
		<div class="addr {{#if $Top.user.pay_ach.info.user_address._id==_id}}focus{{/if}}" event-click="{{'$Top.$Event.pays.change_user_address'}}">
			{{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}}{{town}}{{county}}，{{detail}}
		</div>
	{{/each}}
	<div class="item">
		<div class="title">增加新地址</div>
		<div class="addrbox">
			<select name="province" event-change="{{'$Event.province'}}">
                <option class="first" value="0">请选择省</option>
                {{#each city_list}}
                <option rel="{{region_id}}" value="{{region_name}}">
                    {{region_name}}
                </option>
                {{/each}}
            </select>

            <select name="city" disabled event-change="{{'$Event.city'}}">
                <option class="first" value="0">请选择市</option>
            </select>

            <select name="area" disabled>
                <option class="first" value="0">请选择地区</option>
            </select>
            <input class="items" name="detailed_addre" placeholder="详细地址" />
            <input class="items" name="name" placeholder="姓名" />
            <input class="items" name="mobile_num" placeholder="手机号" />
            <div>
            	<button class="queding" event-click="{{'$Event.add_user_address'}}">确定</button>
            </div>
		</div>
	</div>
</div>
</div>
<div class="submit">
	{{#> "user_ach_controller","user.pay_ach"}}
</div>


<xmp type="tag" name="mbPayMethod">
    <button class="pay-type-wrap {{$Top.user.pay_ach.info.pay_method=='${value}'&&'checked'}}" event-click="{{'$Top.$Event.pays.change_pay_method'}}" event-click-new="{{'$Top.$Event.changepay'}}" ${__all_attrs__} >
        ${text}
    </button>
</xmp>
<link rel="stylesheet" type="text/css" href="/css/catering/mobile_pay.css" />